package com.jic.order.enums;

public enum OrderStatusEnum {
    WAIT_PAY(1, "待支付"),
    ALREADY_PAY(2, "已支付"),
    WAIT_SHIP(3, "待发货"),
    ALREADY_SHIP(4, "已发货"),
    CONFIRM_SHIP(5, "确认收货"),
    WAIT_REVIEW(6, "待评价"),
    CLOSED(7, "已关闭"),
    PAY_PROCESS(8, "付款处理中"),
    REFUND(9, "已退款"),
    FINISH(10, "已完成"),
    WHOLE(11, "全部"),
    DELETE(15, "已删除");

    private Integer code;

    private String message;

    OrderStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static OrderStatusEnum getByCode(Integer code){
        OrderStatusEnum[] values = OrderStatusEnum.values();
        for(OrderStatusEnum value : values){
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


}
